package core.module.playCenter
{
	import flash.events.TimerEvent;
	import flash.utils.Timer;
	
	import mx.controls.Text;
	import mx.effects.Blur;
	import mx.effects.easing.Bounce;
	import mx.events.EffectEvent;

	public class MsgItem extends Text
	{
		private var timer:Timer = null;
		public function MsgItem()
		{
			super();
			setStyle("color","#FFFFFF");
			//timer = new Timer(4000);
			//timer.addEventListener(TimerEvent.TIMER,onTimer);
			//timer.start();
		}
		
		private function onTimer(e:TimerEvent):void
		{
			timer.stop();
			timer.hasEventListener(TimerEvent.TIMER)&&timer.removeEventListener(TimerEvent.TIMER,onTimer);
			timer = null;
			
			var remove:Blur = new Blur();
			remove.blurYFrom = 0;
			remove.blurYTo = 40;
			remove.blurXFrom = 0;
			remove.blurXTo = 80;
			remove.duration = 500;
			remove.addEventListener(EffectEvent.EFFECT_END,onEnd);
			remove.play([this]);
			
		}
		
		private function onEnd(e:EffectEvent):void
		{
			var remove:Blur = e.currentTarget as Blur;
			remove.stop();
			remove.hasEventListener(EffectEvent.EFFECT_END)&&remove.removeEventListener(EffectEvent.EFFECT_END,onEnd);
			remove = null;
			parent.removeChild(this);
		}
		
	}
}